Optimal. Leaf size=140 \[ -\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {3 a^2 b \cos ^5(c+d x)}{5 d}+\frac {b^3 \cos ^5(c+d x)}{5 d}+\frac {a^3 \sin (c+d x)}{d}-\frac {2 a^3 \sin ^3(c+d x)}{3 d}+\frac {a b^2 \sin ^3(c+d x)}{d}+\frac {a^3 \sin ^5(c+d x)}{5 d}-\frac {3 a b^2 \sin ^5(c+d x)}{5 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 140, normalized size of antiderivative = 1.00, number of steps
used = 12, number of rules used = 6, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3169, 2713,
2645, 30, 2644, 14} \begin {gather*} \frac {a^3 \sin ^5(c+d x)}{5 d}-\frac {2 a^3 \sin ^3(c+d x)}{3 d}+\frac {a^3 \sin (c+d x)}{d}-\frac {3 a^2 b \cos ^5(c+d x)}{5 d}-\frac {3 a b^2 \sin ^5(c+d x)}{5 d}+\frac {a b^2 \sin ^3(c+d x)}{d}+\frac {b^3 \cos ^5(c+d x)}{5 d}-\frac {b^3 \cos ^3(c+d x)}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 14
Rule 30
Rule 2644
Rule 2645
Rule 2713
Rule 3169
Rubi steps
\begin {align*} \int \cos ^2(c+d x) (a \cos (c+d x)+b \sin (c+d x))^3 \, dx &=\int \left (a^3 \cos ^5(c+d x)+3 a^2 b \cos ^4(c+d x) \sin (c+d x)+3 a b^2 \cos ^3(c+d x) \sin ^2(c+d x)+b^3 \cos ^2(c+d x) \sin ^3(c+d x)\right ) \, dx\\ &=a^3 \int \cos ^5(c+d x) \, dx+\left (3 a^2 b\right ) \int \cos ^4(c+d x) \sin (c+d x) \, dx+\left (3 a b^2\right ) \int \cos ^3(c+d x) \sin ^2(c+d x) \, dx+b^3 \int \cos ^2(c+d x) \sin ^3(c+d x) \, dx\\ &=-\frac {a^3 \text {Subst}\left (\int \left (1-2 x^2+x^4\right ) \, dx,x,-\sin (c+d x)\right )}{d}-\frac {\left (3 a^2 b\right ) \text {Subst}\left (\int x^4 \, dx,x,\cos (c+d x)\right )}{d}+\frac {\left (3 a b^2\right ) \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\sin (c+d x)\right )}{d}-\frac {b^3 \text {Subst}\left (\int x^2 \left (1-x^2\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {3 a^2 b \cos ^5(c+d x)}{5 d}+\frac {a^3 \sin (c+d x)}{d}-\frac {2 a^3 \sin ^3(c+d x)}{3 d}+\frac {a^3 \sin ^5(c+d x)}{5 d}+\frac {\left (3 a b^2\right ) \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\sin (c+d x)\right )}{d}-\frac {b^3 \text {Subst}\left (\int \left (x^2-x^4\right ) \, dx,x,\cos (c+d x)\right )}{d}\\ &=-\frac {b^3 \cos ^3(c+d x)}{3 d}-\frac {3 a^2 b \cos ^5(c+d x)}{5 d}+\frac {b^3 \cos ^5(c+d x)}{5 d}+\frac {a^3 \sin (c+d x)}{d}-\frac {2 a^3 \sin ^3(c+d x)}{3 d}+\frac {a b^2 \sin ^3(c+d x)}{d}+\frac {a^3 \sin ^5(c+d x)}{5 d}-\frac {3 a b^2 \sin ^5(c+d x)}{5 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.32, size = 150, normalized size = 1.07 \begin {gather*} \frac {-30 b \left (3 a^2+b^2\right ) \cos (c+d x)-5 \left (9 a^2 b+b^3\right ) \cos (3 (c+d x))-9 a^2 b \cos (5 (c+d x))+3 b^3 \cos (5 (c+d x))+150 a^3 \sin (c+d x)+90 a b^2 \sin (c+d x)+25 a^3 \sin (3 (c+d x))-15 a b^2 \sin (3 (c+d x))+3 a^3 \sin (5 (c+d x))-9 a b^2 \sin (5 (c+d x))}{240 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.21, size = 125, normalized size = 0.89
method | result | size |
derivativedivides | \(\frac {b^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )-\frac {3 a^{2} b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {a^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}}{d}\) | \(125\) |
default | \(\frac {b^{3} \left (-\frac {\left (\sin ^{2}\left (d x +c \right )\right ) \left (\cos ^{3}\left (d x +c \right )\right )}{5}-\frac {2 \left (\cos ^{3}\left (d x +c \right )\right )}{15}\right )+3 a \,b^{2} \left (-\frac {\sin \left (d x +c \right ) \left (\cos ^{4}\left (d x +c \right )\right )}{5}+\frac {\left (2+\cos ^{2}\left (d x +c \right )\right ) \sin \left (d x +c \right )}{15}\right )-\frac {3 a^{2} b \left (\cos ^{5}\left (d x +c \right )\right )}{5}+\frac {a^{3} \left (\frac {8}{3}+\cos ^{4}\left (d x +c \right )+\frac {4 \left (\cos ^{2}\left (d x +c \right )\right )}{3}\right ) \sin \left (d x +c \right )}{5}}{d}\) | \(125\) |
risch | \(-\frac {3 a^{2} b \cos \left (d x +c \right )}{8 d}-\frac {b^{3} \cos \left (d x +c \right )}{8 d}+\frac {5 a^{3} \sin \left (d x +c \right )}{8 d}+\frac {3 a \,b^{2} \sin \left (d x +c \right )}{8 d}-\frac {3 b \cos \left (5 d x +5 c \right ) a^{2}}{80 d}+\frac {b^{3} \cos \left (5 d x +5 c \right )}{80 d}+\frac {a^{3} \sin \left (5 d x +5 c \right )}{80 d}-\frac {3 a \sin \left (5 d x +5 c \right ) b^{2}}{80 d}-\frac {3 b \cos \left (3 d x +3 c \right ) a^{2}}{16 d}-\frac {b^{3} \cos \left (3 d x +3 c \right )}{48 d}+\frac {5 a^{3} \sin \left (3 d x +3 c \right )}{48 d}-\frac {a \sin \left (3 d x +3 c \right ) b^{2}}{16 d}\) | \(200\) |
norman | \(\frac {-\frac {18 a^{2} b +4 b^{3}}{15 d}+\frac {2 a^{3} \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}+\frac {2 a^{3} \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 b^{3} \left (\tan ^{6}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {4 b^{3} \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}-\frac {6 a^{2} b \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-\frac {2 \left (18 a^{2} b -2 b^{3}\right ) \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 a \left (a^{2}+3 b^{2}\right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {8 a \left (a^{2}+3 b^{2}\right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{3 d}+\frac {4 a \left (29 a^{2}-12 b^{2}\right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{15 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{5}}\) | \(237\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.28, size = 107, normalized size = 0.76 \begin {gather*} -\frac {9 \, a^{2} b \cos \left (d x + c\right )^{5} - {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} a^{3} + 3 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 5 \, \sin \left (d x + c\right )^{3}\right )} a b^{2} - {\left (3 \, \cos \left (d x + c\right )^{5} - 5 \, \cos \left (d x + c\right )^{3}\right )} b^{3}}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.96, size = 102, normalized size = 0.73 \begin {gather*} -\frac {5 \, b^{3} \cos \left (d x + c\right )^{3} + 3 \, {\left (3 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{5} - {\left (3 \, {\left (a^{3} - 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{4} + 8 \, a^{3} + 6 \, a b^{2} + {\left (4 \, a^{3} + 3 \, a b^{2}\right )} \cos \left (d x + c\right )^{2}\right )} \sin \left (d x + c\right )}{15 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.28, size = 182, normalized size = 1.30 \begin {gather*} \begin {cases} \frac {8 a^{3} \sin ^{5}{\left (c + d x \right )}}{15 d} + \frac {4 a^{3} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{3 d} + \frac {a^{3} \sin {\left (c + d x \right )} \cos ^{4}{\left (c + d x \right )}}{d} - \frac {3 a^{2} b \cos ^{5}{\left (c + d x \right )}}{5 d} + \frac {2 a b^{2} \sin ^{5}{\left (c + d x \right )}}{5 d} + \frac {a b^{2} \sin ^{3}{\left (c + d x \right )} \cos ^{2}{\left (c + d x \right )}}{d} - \frac {b^{3} \sin ^{2}{\left (c + d x \right )} \cos ^{3}{\left (c + d x \right )}}{3 d} - \frac {2 b^{3} \cos ^{5}{\left (c + d x \right )}}{15 d} & \text {for}\: d \neq 0 \\x \left (a \cos {\left (c \right )} + b \sin {\left (c \right )}\right )^{3} \cos ^{2}{\left (c \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 145, normalized size = 1.04 \begin {gather*} -\frac {{\left (3 \, a^{2} b - b^{3}\right )} \cos \left (5 \, d x + 5 \, c\right )}{80 \, d} - \frac {{\left (9 \, a^{2} b + b^{3}\right )} \cos \left (3 \, d x + 3 \, c\right )}{48 \, d} - \frac {{\left (3 \, a^{2} b + b^{3}\right )} \cos \left (d x + c\right )}{8 \, d} + \frac {{\left (a^{3} - 3 \, a b^{2}\right )} \sin \left (5 \, d x + 5 \, c\right )}{80 \, d} + \frac {{\left (5 \, a^{3} - 3 \, a b^{2}\right )} \sin \left (3 \, d x + 3 \, c\right )}{48 \, d} + \frac {{\left (5 \, a^{3} + 3 \, a b^{2}\right )} \sin \left (d x + c\right )}{8 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.70, size = 147, normalized size = 1.05 \begin {gather*} \frac {2\,\left (\frac {3\,\sin \left (c+d\,x\right )\,a^3\,{\cos \left (c+d\,x\right )}^4}{2}+2\,\sin \left (c+d\,x\right )\,a^3\,{\cos \left (c+d\,x\right )}^2+4\,\sin \left (c+d\,x\right )\,a^3-\frac {9\,a^2\,b\,{\cos \left (c+d\,x\right )}^5}{2}-\frac {9\,\sin \left (c+d\,x\right )\,a\,b^2\,{\cos \left (c+d\,x\right )}^4}{2}+\frac {3\,\sin \left (c+d\,x\right )\,a\,b^2\,{\cos \left (c+d\,x\right )}^2}{2}+3\,\sin \left (c+d\,x\right )\,a\,b^2+\frac {3\,b^3\,{\cos \left (c+d\,x\right )}^5}{2}-\frac {5\,b^3\,{\cos \left (c+d\,x\right )}^3}{2}\right )}{15\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________